<?php require_once("auth.php"); ?>
<?php

include("config.php");
 if(isset($_REQUEST['brandid']))
{

$id=$_REQUEST['brandid'];
$query="delete from brands where brandid=$id";
	if(mysql_query($query))
	{
	header('location:displaybrand.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['categoryid']))
{
$id=$_REQUEST['categoryid'];
$query="delete from maincategories where maincatid=$id";
	if(mysql_query($query))
	{
	header('location:displaycategory.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['compid']))
{
$id=$_REQUEST['compid'];
$query="delete from items where itemid=$id";
	if(mysql_query($query))
	{
	header('location:displaycomputers.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['subcategoryid']))
{
$id=$_REQUEST['subcategoryid'];
$query="delete from subcategory where subcatid=$id";
	if(mysql_query($query))
	{
	header('location:displaysubcategory.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else
{echo mysql_error();

}
?>